<template>
	<view style="width: 100%;min-height: 100vh;"
		:style="{background:'url('+Imgbase+'/new_goodmy_bgc.png)','background-size':'100%',}">

		<view class="padding-top-50 padding-left-40 ">
			<image class="w-80 h-80" style="width: 80rpx; height: 80rpx;" :src="Imgbase + '/new_goodlx_img1.png'" mode="aspectFit" @click="back">
			</image>
		</view>

		<view class="">
			<view class="u-demo-block w-700 h-380" style="position: relative;"
				:style="{background:'url('+Imgbase+'/new_goodpai_img3.png)','background-size':'100% 100%',}">
				<!-- <view class="">
						<image class="w-80 h-80" :src="Imgbase + '/new_goodlx_img1.png'" mode="aspectFit">
						</image>
				</view> -->

				<view class="tower-swiper h100" @touchmove="TowerMove" @touchstart="TowerStart" @touchend="TowerEnd">
					<view class="tower-item" v-for="(item,index) in swiperList" :key="index" :style="[{'--index': item.zIndex,'--left':item.mLeft,
					width:item.mLeft == 0?'315rpx':'180rpx',
					height:item.mLeft == 0?'255rpx':'130rpx',
					left:item.mLeft == 0?'50%':'50%',
					opacity:item.mLeft == 0?'1':'0.4',}]" :data-direction="direction">
						<view class="swiper-item w100 h100 margin-top-50"
							:class="item.mLeft == -1?'leftitem':''">
							<image class="w100 h100" :src="item.adimage" s mode="aspectFit"></image>
						</view>
					</view>
				</view>

				<!-- <view class="">
						<image class="w-80 h-80" :src="Imgbase + '/new_goodlx_img1.png'" mode="aspectFit">
						</image>
				</view> -->
			</view>
		</view>

		<view class="h-125" style="margin: 50rpx auto;" @click="changeUserPray()">
			<image class="w-400 h-125" :src="Imgbase + '/new_goodpai_img6.png'" mode="aspectFit"></image>
		</view>

		<view class="border">
			<view class="" style="padding-bottom: 10rpx;">
				{{desc.title}}:
			</view>
			<view class="news-content" v-html="desc.content">
			</view>
		</view>
		<u-toast ref="uToast"></u-toast>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				Imgbase: getApp().globalData.Imgbase,
				swiperList: [],
				towerStart: 0,
				direction: '',
				num: 2,
				desc: '',
				pray_number: ''
			}
		},
		methods: {
			back() {
				uni.navigateBack()
			},
			userFront() {
				let _this = this
				uni.request({
					url: _this.$globals.apibase + '/api/Userways/userFront',
					data: {
						token: uni.getStorageSync('token'),
					},
					method: 'POST',
					header: {
						'content-type': 'application/json'
					},
					success: (res) => {
						if (res.data.code == '401') {
							uni.setStorageSync('token', '');
							_this.$uniApi.trylogin();
						}
						if (res.data.code == '1') {
							_this.pray_number = res.data.data.user_desc.pray_number;
							console.log(_this.pray_number)

							if (_this.pray_number == 0) {
								_this.swiperList = [{
										adimage: 'https://oqyf-1305090490.cos.ap-shanghai.myqcloud.com/front/new_goodsoc_lucknum8.png',
										zIndex: 1,
										mLeft: -2,
										num: 8
									},
									{
										adimage: 'https://oqyf-1305090490.cos.ap-shanghai.myqcloud.com/front/new_goodsoc_lucknum9.png',
										zIndex: 2,
										mLeft: -1,
										num: 9
									},
									{
										adimage: 'https://oqyf-1305090490.cos.ap-shanghai.myqcloud.com/front/new_goodsoc_lucknum0.png',
										zIndex: 3,
										mLeft: 0,
										num: 0
									},

									{
										adimage: 'https://oqyf-1305090490.cos.ap-shanghai.myqcloud.com/front/new_goodsoc_lucknum1.png',
										zIndex: 1,
										mLeft: 1,
										num: 1
									},

									{
										adimage: 'https://oqyf-1305090490.cos.ap-shanghai.myqcloud.com/front/new_goodsoc_lucknum2.png',
										zIndex: 1,
										mLeft: -2,
										num: 2
									},
									{
										adimage: 'https://oqyf-1305090490.cos.ap-shanghai.myqcloud.com/front/new_goodsoc_lucknum3.png',
										zIndex: 1,
										mLeft: -2,
										num: 3
									},
									{
										adimage: 'https://oqyf-1305090490.cos.ap-shanghai.myqcloud.com/front/new_goodsoc_lucknum4.png',
										zIndex: 1,
										mLeft: -2,
										num: 4
									},
									{
										adimage: 'https://oqyf-1305090490.cos.ap-shanghai.myqcloud.com/front/new_goodsoc_lucknum5.png',
										zIndex: 1,
										mLeft: -2,
										num: 5
									},
									{
										adimage: 'https://oqyf-1305090490.cos.ap-shanghai.myqcloud.com/front/new_goodsoc_lucknum6.png',
										zIndex: 1,
										mLeft: -2,
										num: 6
									},
									{
										adimage: 'https://oqyf-1305090490.cos.ap-shanghai.myqcloud.com/front/new_goodsoc_lucknum7.png',
										zIndex: 1,
										mLeft: -2,
										num: 7
									}
								]
							} else if (_this.pray_number == 1) {
								_this.swiperList = [{
										adimage: 'https://oqyf-1305090490.cos.ap-shanghai.myqcloud.com/front/new_goodsoc_lucknum9.png',
										zIndex: 1,
										mLeft: -2,
										num: 9
									},
									{
										adimage: 'https://oqyf-1305090490.cos.ap-shanghai.myqcloud.com/front/new_goodsoc_lucknum0.png',
										zIndex: 2,
										mLeft: -1,
										num: 0
									},
									{
										adimage: 'https://oqyf-1305090490.cos.ap-shanghai.myqcloud.com/front/new_goodsoc_lucknum1.png',
										zIndex: 3,
										mLeft: 0,
										num: 1
									},

									{
										adimage: 'https://oqyf-1305090490.cos.ap-shanghai.myqcloud.com/front/new_goodsoc_lucknum2.png',
										zIndex: 1,
										mLeft: 1,
										num: 2
									},

									{
										adimage: 'https://oqyf-1305090490.cos.ap-shanghai.myqcloud.com/front/new_goodsoc_lucknum3.png',
										zIndex: 1,
										mLeft: -2,
										num: 3
									},
									{
										adimage: 'https://oqyf-1305090490.cos.ap-shanghai.myqcloud.com/front/new_goodsoc_lucknum4.png',
										zIndex: 1,
										mLeft: -2,
										num: 4
									},
									{
										adimage: 'https://oqyf-1305090490.cos.ap-shanghai.myqcloud.com/front/new_goodsoc_lucknum5.png',
										zIndex: 1,
										mLeft: -2,
										num: 5
									},
									{
										adimage: 'https://oqyf-1305090490.cos.ap-shanghai.myqcloud.com/front/new_goodsoc_lucknum6.png',
										zIndex: 1,
										mLeft: -2,
										num: 6
									},
									{
										adimage: 'https://oqyf-1305090490.cos.ap-shanghai.myqcloud.com/front/new_goodsoc_lucknum7.png',
										zIndex: 1,
										mLeft: -2,
										num: 7
									},
									{
										adimage: 'https://oqyf-1305090490.cos.ap-shanghai.myqcloud.com/front/new_goodsoc_lucknum8.png',
										zIndex: 1,
										mLeft: -2,
										num: 8
									}
								]
							} else if (_this.pray_number == 2) {
								_this.swiperList = [{
										adimage: 'https://oqyf-1305090490.cos.ap-shanghai.myqcloud.com/front/new_goodsoc_lucknum0.png',
										zIndex: 1,
										mLeft: -2,
										num: 0
									},
									{
										adimage: 'https://oqyf-1305090490.cos.ap-shanghai.myqcloud.com/front/new_goodsoc_lucknum1.png',
										zIndex: 2,
										mLeft: -1,
										num: 1
									},
									{
										adimage: 'https://oqyf-1305090490.cos.ap-shanghai.myqcloud.com/front/new_goodsoc_lucknum2.png',
										zIndex: 3,
										mLeft: 0,
										num: 2
									},

									{
										adimage: 'https://oqyf-1305090490.cos.ap-shanghai.myqcloud.com/front/new_goodsoc_lucknum3.png',
										zIndex: 1,
										mLeft: 1,
										num: 3
									},

									{
										adimage: 'https://oqyf-1305090490.cos.ap-shanghai.myqcloud.com/front/new_goodsoc_lucknum4.png',
										zIndex: 1,
										mLeft: -2,
										num: 4
									},
									{
										adimage: 'https://oqyf-1305090490.cos.ap-shanghai.myqcloud.com/front/new_goodsoc_lucknum5.png',
										zIndex: 1,
										mLeft: -2,
										num: 5
									},
									{
										adimage: 'https://oqyf-1305090490.cos.ap-shanghai.myqcloud.com/front/new_goodsoc_lucknum6.png',
										zIndex: 1,
										mLeft: -2,
										num: 6
									},
									{
										adimage: 'https://oqyf-1305090490.cos.ap-shanghai.myqcloud.com/front/new_goodsoc_lucknum7.png',
										zIndex: 1,
										mLeft: -2,
										num: 7
									},
									{
										adimage: 'https://oqyf-1305090490.cos.ap-shanghai.myqcloud.com/front/new_goodsoc_lucknum8.png',
										zIndex: 1,
										mLeft: -2,
										num: 8
									},
									{
										adimage: 'https://oqyf-1305090490.cos.ap-shanghai.myqcloud.com/front/new_goodsoc_lucknum9.png',
										zIndex: 1,
										mLeft: -2,
										num: 9
									}
								]
							} else if (_this.pray_number == 3) {
								_this.swiperList = [{
										adimage: 'https://oqyf-1305090490.cos.ap-shanghai.myqcloud.com/front/new_goodsoc_lucknum1.png',
										zIndex: 1,
										mLeft: -2,
										num: 1
									},
									{
										adimage: 'https://oqyf-1305090490.cos.ap-shanghai.myqcloud.com/front/new_goodsoc_lucknum2.png',
										zIndex: 2,
										mLeft: -1,
										num: 2
									},
									{
										adimage: 'https://oqyf-1305090490.cos.ap-shanghai.myqcloud.com/front/new_goodsoc_lucknum3.png',
										zIndex: 3,
										mLeft: 0,
										num: 3
									},

									{
										adimage: 'https://oqyf-1305090490.cos.ap-shanghai.myqcloud.com/front/new_goodsoc_lucknum4.png',
										zIndex: 1,
										mLeft: 1,
										num: 4
									},

									{
										adimage: 'https://oqyf-1305090490.cos.ap-shanghai.myqcloud.com/front/new_goodsoc_lucknum5.png',
										zIndex: 1,
										mLeft: -2,
										num: 5
									},
									{
										adimage: 'https://oqyf-1305090490.cos.ap-shanghai.myqcloud.com/front/new_goodsoc_lucknum6.png',
										zIndex: 1,
										mLeft: -2,
										num: 6
									},
									{
										adimage: 'https://oqyf-1305090490.cos.ap-shanghai.myqcloud.com/front/new_goodsoc_lucknum7.png',
										zIndex: 1,
										mLeft: -2,
										num: 7
									},
									{
										adimage: 'https://oqyf-1305090490.cos.ap-shanghai.myqcloud.com/front/new_goodsoc_lucknum8.png',
										zIndex: 1,
										mLeft: -2,
										num: 8
									},
									{
										adimage: 'https://oqyf-1305090490.cos.ap-shanghai.myqcloud.com/front/new_goodsoc_lucknum9.png',
										zIndex: 1,
										mLeft: -2,
										num: 9
									},
									{
										adimage: 'https://oqyf-1305090490.cos.ap-shanghai.myqcloud.com/front/new_goodsoc_lucknum0.png',
										zIndex: 1,
										mLeft: -2,
										num: 0
									}
								]
							} else if (_this.pray_number == 4) {
								_this.swiperList = [{
										adimage: 'https://oqyf-1305090490.cos.ap-shanghai.myqcloud.com/front/new_goodsoc_lucknum2.png',
										zIndex: 1,
										mLeft: -2,
										num: 2
									},
									{
										adimage: 'https://oqyf-1305090490.cos.ap-shanghai.myqcloud.com/front/new_goodsoc_lucknum3.png',
										zIndex: 2,
										mLeft: -1,
										num: 3
									},
									{
										adimage: 'https://oqyf-1305090490.cos.ap-shanghai.myqcloud.com/front/new_goodsoc_lucknum4.png',
										zIndex: 3,
										mLeft: 0,
										num: 4
									},

									{
										adimage: 'https://oqyf-1305090490.cos.ap-shanghai.myqcloud.com/front/new_goodsoc_lucknum5.png',
										zIndex: 1,
										mLeft: 1,
										num: 5
									},

									{
										adimage: 'https://oqyf-1305090490.cos.ap-shanghai.myqcloud.com/front/new_goodsoc_lucknum6.png',
										zIndex: 1,
										mLeft: -2,
										num: 6
									},
									{
										adimage: 'https://oqyf-1305090490.cos.ap-shanghai.myqcloud.com/front/new_goodsoc_lucknum7.png',
										zIndex: 1,
										mLeft: -2,
										num: 7
									},
									{
										adimage: 'https://oqyf-1305090490.cos.ap-shanghai.myqcloud.com/front/new_goodsoc_lucknum8.png',
										zIndex: 1,
										mLeft: -2,
										num: 8
									},
									{
										adimage: 'https://oqyf-1305090490.cos.ap-shanghai.myqcloud.com/front/new_goodsoc_lucknum9.png',
										zIndex: 1,
										mLeft: -2,
										num: 9
									},
									{
										adimage: 'https://oqyf-1305090490.cos.ap-shanghai.myqcloud.com/front/new_goodsoc_lucknum0.png',
										zIndex: 1,
										mLeft: -2,
										num: 0
									},
									{
										adimage: 'https://oqyf-1305090490.cos.ap-shanghai.myqcloud.com/front/new_goodsoc_lucknum1.png',
										zIndex: 1,
										mLeft: -2,
										num: 1
									}
								]
							} else if (_this.pray_number == 5) {
								_this.swiperList = [{
										adimage: 'https://oqyf-1305090490.cos.ap-shanghai.myqcloud.com/front/new_goodsoc_lucknum3.png',
										zIndex: 1,
										mLeft: -2,
										num: 3
									},
									{
										adimage: 'https://oqyf-1305090490.cos.ap-shanghai.myqcloud.com/front/new_goodsoc_lucknum4.png',
										zIndex: 2,
										mLeft: -1,
										num: 4
									},
									{
										adimage: 'https://oqyf-1305090490.cos.ap-shanghai.myqcloud.com/front/new_goodsoc_lucknum5.png',
										zIndex: 3,
										mLeft: 0,
										num: 5
									},

									{
										adimage: 'https://oqyf-1305090490.cos.ap-shanghai.myqcloud.com/front/new_goodsoc_lucknum6.png',
										zIndex: 1,
										mLeft: 1,
										num: 6
									},

									{
										adimage: 'https://oqyf-1305090490.cos.ap-shanghai.myqcloud.com/front/new_goodsoc_lucknum7.png',
										zIndex: 1,
										mLeft: -2,
										num: 7
									},
									{
										adimage: 'https://oqyf-1305090490.cos.ap-shanghai.myqcloud.com/front/new_goodsoc_lucknum8.png',
										zIndex: 1,
										mLeft: -2,
										num: 8
									},
									{
										adimage: 'https://oqyf-1305090490.cos.ap-shanghai.myqcloud.com/front/new_goodsoc_lucknum9.png',
										zIndex: 1,
										mLeft: -2,
										num: 9
									},
									{
										adimage: 'https://oqyf-1305090490.cos.ap-shanghai.myqcloud.com/front/new_goodsoc_lucknum0.png',
										zIndex: 1,
										mLeft: -2,
										num: 0
									},
									{
										adimage: 'https://oqyf-1305090490.cos.ap-shanghai.myqcloud.com/front/new_goodsoc_lucknum1.png',
										zIndex: 1,
										mLeft: -2,
										num: 1
									},
									{
										adimage: 'https://oqyf-1305090490.cos.ap-shanghai.myqcloud.com/front/new_goodsoc_lucknum2.png',
										zIndex: 1,
										mLeft: -2,
										num: 2
									}
								]
							} else if (_this.pray_number == 6) {
								_this.swiperList = [{
										adimage: 'https://oqyf-1305090490.cos.ap-shanghai.myqcloud.com/front/new_goodsoc_lucknum4.png',
										zIndex: 1,
										mLeft: -2,
										num: 4
									},
									{
										adimage: 'https://oqyf-1305090490.cos.ap-shanghai.myqcloud.com/front/new_goodsoc_lucknum5.png',
										zIndex: 2,
										mLeft: -1,
										num: 5
									},
									{
										adimage: 'https://oqyf-1305090490.cos.ap-shanghai.myqcloud.com/front/new_goodsoc_lucknum6.png',
										zIndex: 3,
										mLeft: 0,
										num: 6
									},

									{
										adimage: 'https://oqyf-1305090490.cos.ap-shanghai.myqcloud.com/front/new_goodsoc_lucknum7.png',
										zIndex: 1,
										mLeft: 1,
										num: 7
									},

									{
										adimage: 'https://oqyf-1305090490.cos.ap-shanghai.myqcloud.com/front/new_goodsoc_lucknum8.png',
										zIndex: 1,
										mLeft: -2,
										num: 8
									},
									{
										adimage: 'https://oqyf-1305090490.cos.ap-shanghai.myqcloud.com/front/new_goodsoc_lucknum9.png',
										zIndex: 1,
										mLeft: -2,
										num: 9
									},
									{
										adimage: 'https://oqyf-1305090490.cos.ap-shanghai.myqcloud.com/front/new_goodsoc_lucknum0.png',
										zIndex: 1,
										mLeft: -2,
										num: 0
									},
									{
										adimage: 'https://oqyf-1305090490.cos.ap-shanghai.myqcloud.com/front/new_goodsoc_lucknum1.png',
										zIndex: 1,
										mLeft: -2,
										num: 1
									},
									{
										adimage: 'https://oqyf-1305090490.cos.ap-shanghai.myqcloud.com/front/new_goodsoc_lucknum2.png',
										zIndex: 1,
										mLeft: -2,
										num: 2
									},
									{
										adimage: 'https://oqyf-1305090490.cos.ap-shanghai.myqcloud.com/front/new_goodsoc_lucknum3.png',
										zIndex: 1,
										mLeft: -2,
										num: 3
									}
								]
							} else if (_this.pray_number == 7) {
								_this.swiperList = [{
										adimage: 'https://oqyf-1305090490.cos.ap-shanghai.myqcloud.com/front/new_goodsoc_lucknum5.png',
										zIndex: 1,
										mLeft: -2,
										num: 5
									},
									{
										adimage: 'https://oqyf-1305090490.cos.ap-shanghai.myqcloud.com/front/new_goodsoc_lucknum6.png',
										zIndex: 2,
										mLeft: -1,
										num: 6
									},
									{
										adimage: 'https://oqyf-1305090490.cos.ap-shanghai.myqcloud.com/front/new_goodsoc_lucknum7.png',
										zIndex: 3,
										mLeft: 0,
										num: 7
									},

									{
										adimage: 'https://oqyf-1305090490.cos.ap-shanghai.myqcloud.com/front/new_goodsoc_lucknum8.png',
										zIndex: 1,
										mLeft: 1,
										num: 8
									},

									{
										adimage: 'https://oqyf-1305090490.cos.ap-shanghai.myqcloud.com/front/new_goodsoc_lucknum9.png',
										zIndex: 1,
										mLeft: -2,
										num: 9
									},
									{
										adimage: 'https://oqyf-1305090490.cos.ap-shanghai.myqcloud.com/front/new_goodsoc_lucknum0.png',
										zIndex: 1,
										mLeft: -2,
										num: 0
									},
									{
										adimage: 'https://oqyf-1305090490.cos.ap-shanghai.myqcloud.com/front/new_goodsoc_lucknum1.png',
										zIndex: 1,
										mLeft: -2,
										num: 1
									},
									{
										adimage: 'https://oqyf-1305090490.cos.ap-shanghai.myqcloud.com/front/new_goodsoc_lucknum2.png',
										zIndex: 1,
										mLeft: -2,
										num: 2
									},
									{
										adimage: 'https://oqyf-1305090490.cos.ap-shanghai.myqcloud.com/front/new_goodsoc_lucknum3.png',
										zIndex: 1,
										mLeft: -2,
										num: 3
									},
									{
										adimage: 'https://oqyf-1305090490.cos.ap-shanghai.myqcloud.com/front/new_goodsoc_lucknum4.png',
										zIndex: 1,
										mLeft: -2,
										num: 4
									}
								]
							} else if (_this.pray_number == 8) {
								_this.swiperList = [{
										adimage: 'https://oqyf-1305090490.cos.ap-shanghai.myqcloud.com/front/new_goodsoc_lucknum6.png',
										zIndex: 1,
										mLeft: -2,
										num: 6
									},
									{
										adimage: 'https://oqyf-1305090490.cos.ap-shanghai.myqcloud.com/front/new_goodsoc_lucknum7.png',
										zIndex: 2,
										mLeft: -1,
										num: 7
									},
									{
										adimage: 'https://oqyf-1305090490.cos.ap-shanghai.myqcloud.com/front/new_goodsoc_lucknum8.png',
										zIndex: 3,
										mLeft: 0,
										num: 8
									},

									{
										adimage: 'https://oqyf-1305090490.cos.ap-shanghai.myqcloud.com/front/new_goodsoc_lucknum9.png',
										zIndex: 1,
										mLeft: 1,
										num: 9
									},

									{
										adimage: 'https://oqyf-1305090490.cos.ap-shanghai.myqcloud.com/front/new_goodsoc_lucknum0.png',
										zIndex: 1,
										mLeft: -2,
										num: 0
									},
									{
										adimage: 'https://oqyf-1305090490.cos.ap-shanghai.myqcloud.com/front/new_goodsoc_lucknum1.png',
										zIndex: 1,
										mLeft: -2,
										num: 1
									},
									{
										adimage: 'https://oqyf-1305090490.cos.ap-shanghai.myqcloud.com/front/new_goodsoc_lucknum2.png',
										zIndex: 1,
										mLeft: -2,
										num: 2
									},
									{
										adimage: 'https://oqyf-1305090490.cos.ap-shanghai.myqcloud.com/front/new_goodsoc_lucknum3.png',
										zIndex: 1,
										mLeft: -2,
										num: 3
									},
									{
										adimage: 'https://oqyf-1305090490.cos.ap-shanghai.myqcloud.com/front/new_goodsoc_lucknum4.png',
										zIndex: 1,
										mLeft: -2,
										num: 4
									},
									{
										adimage: 'https://oqyf-1305090490.cos.ap-shanghai.myqcloud.com/front/new_goodsoc_lucknum5.png',
										zIndex: 1,
										mLeft: -2,
										num: 5
									}
								]
							} else if (_this.pray_number == 9) {
								_this.swiperList = [{
										adimage: 'https://oqyf-1305090490.cos.ap-shanghai.myqcloud.com/front/new_goodsoc_lucknum7.png',
										zIndex: 1,
										mLeft: -2,
										num: 7
									},
									{
										adimage: 'https://oqyf-1305090490.cos.ap-shanghai.myqcloud.com/front/new_goodsoc_lucknum8.png',
										zIndex: 2,
										mLeft: -1,
										num: 8
									},
									{
										adimage: 'https://oqyf-1305090490.cos.ap-shanghai.myqcloud.com/front/new_goodsoc_lucknum9.png',
										zIndex: 3,
										mLeft: 0,
										num: 9
									},

									{
										adimage: 'https://oqyf-1305090490.cos.ap-shanghai.myqcloud.com/front/new_goodsoc_lucknum0.png',
										zIndex: 1,
										mLeft: 1,
										num: 0
									},

									{
										adimage: 'https://oqyf-1305090490.cos.ap-shanghai.myqcloud.com/front/new_goodsoc_lucknum1.png',
										zIndex: 1,
										mLeft: -2,
										num: 1
									},
									{
										adimage: 'https://oqyf-1305090490.cos.ap-shanghai.myqcloud.com/front/new_goodsoc_lucknum2.png',
										zIndex: 1,
										mLeft: -2,
										num: 2
									},
									{
										adimage: 'https://oqyf-1305090490.cos.ap-shanghai.myqcloud.com/front/new_goodsoc_lucknum3.png',
										zIndex: 1,
										mLeft: -2,
										num: 3
									},
									{
										adimage: 'https://oqyf-1305090490.cos.ap-shanghai.myqcloud.com/front/new_goodsoc_lucknum4.png',
										zIndex: 1,
										mLeft: -2,
										num: 4
									},
									{
										adimage: 'https://oqyf-1305090490.cos.ap-shanghai.myqcloud.com/front/new_goodsoc_lucknum5.png',
										zIndex: 1,
										mLeft: -2,
										num: 5
									},
									{
										adimage: 'https://oqyf-1305090490.cos.ap-shanghai.myqcloud.com/front/new_goodsoc_lucknum6.png',
										zIndex: 1,
										mLeft: -2,
										num: 6
									}
								]
							}
						}
					}
				});
			},

			explain() {
				let _this = this;
				uni.request({
					url: _this.$globals.apibase + '/api/Index/explain',
					data: {
						id: 12
					},
					method: 'POST',
					header: {
						'content-type': 'application/json'
					},
					success: (res) => {
						_this.desc = res.data.data.desc;
					}
				});
			},
			changeUserPray() {
				let _this = this
				uni.request({
					url: _this.$globals.apibase + '/api/Usersys/changeUserPray',
					data: {
						token: uni.getStorageSync('token'),
						number: this.num,
					},
					method: 'POST',
					header: {
						'content-type': 'application/json'
					},
					success: (res) => {
						if (res.data.code == '401') {
							uni.setStorageSync('token', '');
							_this.$uniApi.trylogin();
						}
						if (res.data.code == '1') {
							this.$refs.uToast.show({
								type: 'default',
								title: '默认主题',
								message: "设置成功",
							})
						}
						if (res.data.code == '0') {
							uni.showToast({
								icon: 'none',
								title: res.data.msg
							});
						}
					}
				});
			},
			// towerSwiper触摸开始
			TowerStart(e) {
				this.towerStart = e.touches[0].pageX
			},
			// towerSwiper计算方向
			TowerMove(e) {
				this.direction = e.touches[0].pageX - this.towerStart > 0 ? 'right' : 'left'
			},
			// towerSwiper计算滚动
			TowerEnd(e) {
				let direction = this.direction;
				let list = this.swiperList;
				if (direction == 'right') {
					let mLeft = list[0].mLeft;
					let zIndex = list[0].zIndex;
					for (let i = 1; i < this.swiperList.length; i++) {
						this.swiperList[i - 1].mLeft = this.swiperList[i].mLeft
						this.swiperList[i - 1].zIndex = this.swiperList[i].zIndex
					}
					this.swiperList[list.length - 1].mLeft = mLeft;
					this.swiperList[list.length - 1].zIndex = zIndex;
				} else {
					let mLeft = list[list.length - 1].mLeft;
					let zIndex = list[list.length - 1].zIndex;
					for (let i = this.swiperList.length - 1; i > 0; i--) {
						this.swiperList[i].mLeft = this.swiperList[i - 1].mLeft
						this.swiperList[i].zIndex = this.swiperList[i - 1].zIndex
					}
					this.swiperList[0].mLeft = mLeft;
					this.swiperList[0].zIndex = zIndex;
				}
				this.direction = ""
				this.getMes()
				this.swiperList = this.swiperList
			},
			getMes() {
				for (let i = 0; i < this.swiperList.length; i++) {
					if (this.swiperList[i].mLeft == 0) {
						this.num = this.swiperList[i].num;
					}
				}
			},
		},
		onLoad(e) {
			this.userFront()
			this.explain()
		}
	}
</script>

<style lang="scss" scoped>
	.leftitem {
		position: absolute;
		right: -210rpx;
	}

	image {
		width: 100%;
		height: 100%;
	}

	.title {
		width: 500rpx;
		margin: 50rpx auto 0;
	}

	.u-demo-block {
		// width: 90%;
		margin: 50rpx auto 0;


	}

	.tower-swiper .tower-item {
		transform: scale(calc(0.5 + var(--index) / 20));
		margin-left: calc(var(--left) * 280upx - 150upx);
		z-index: var(--index);
		
	}

	.border {
		width: 95%;
		margin: 0 auto;
		border: 5rpx solid #BF9F58;
		padding: 20rpx;
		border-radius: 15rpx;
	}
</style>